<template>
  <div class="lifting-device-container">
    <div class="screen-conditions-container">
      <ScreenConditions :isDataType="false">
        <template slot="conditions">
          <a-select placeholder="请选择设备" v-model="condition.equCode">
            <a-select-option
              :value="item.equCode"
              v-for="item in condition.equSource"
              :key="item.id"
            >
              {{ item.equName }}
            </a-select-option>
          </a-select>
        </template>
        <template slot="operate">
          <a-button type="primary" @click="search()"> 查询 </a-button>
        </template>
      </ScreenConditions>
    </div>
    <div class="header" header="实时监测">
      <div>
        <a-button type="primary" @click="gotoRecord()"> 历史监测记录 </a-button>
        <a-button type="primary" @click="gotoWarning()"> 预警推送 </a-button>
      </div>
    </div>
    <div class="main">
      <div class="body">
        <div class="top">
          <div class="left">
            <div class="title">前车参数</div>
            <div class="hook-state">
              <div class="state">
                <span class="fillet">●</span>前车主钩重量：
                <span class="nums"> {{ form.j7 }} </span>t
              </div>
              <div class="state">
                <span class="fillet">●</span>前车副钩重量：
                <span class="nums">{{ form.j10 }} </span>t
              </div>
              <div class="state">
                <span class="fillet">●</span>前车主钩深度：
                <span class="nums"> {{ form.j8 }} </span>m
              </div>
              <div class="state">
                <span class="fillet">●</span>前车副钩深度：
                <span class="nums">{{ form.j11 }} </span>m
              </div>
              <div class="state">
                <span class="fillet">●</span>前车主钩速度：
                <span class="nums">{{ form.j9 }} </span>m/s
              </div>
              <div class="state">
                <span class="fillet">●</span> 前车副钩速度：
                <span class="nums"> {{ form.j12 }} </span>m/s
              </div>
              <div class="state" style="width: 100%">
                <span class="fillet">●</span> 前车位置：
                <span class="nums">{{ form.j20 }} </span>m
              </div>
            </div>
            <div class="qc-container">
              <div class="item">
                <div
                  :class="[
                    form.j73 == 'true'
                      ? 'normal-icon'
                      : form.j73 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  前车前进：<span
                    :class="[
                      form.j73 == 'true'
                        ? 'normal'
                        : form.j73 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j73 == "true"
                        ? "正常"
                        : form.j73 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j74 == 'true'
                      ? 'normal-icon'
                      : form.j74 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  前车后退：<span
                    :class="[
                      form.j74 == 'true'
                        ? 'normal'
                        : form.j74 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j74 == "true"
                        ? "正常"
                        : form.j74 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j77 == 'true'
                      ? 'normal-icon'
                      : form.j77 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  前主卷扬提钩：<span
                    :class="[
                      form.j77 == 'true'
                        ? 'normal'
                        : form.j77 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j77 == "true"
                        ? "正常"
                        : form.j77 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j78 == 'true'
                      ? 'normal-icon'
                      : form.j78 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  前主卷扬落钩：<span
                    :class="[
                      form.j78 == 'true'
                        ? 'normal'
                        : form.j78 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j78 == "true"
                        ? "正常"
                        : form.j78 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j79 == 'true'
                      ? 'normal-icon'
                      : form.j79 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  前副卷扬提钩：<span
                    :class="[
                      form.j79 == 'true'
                        ? 'normal'
                        : form.j79 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j79 == "true"
                        ? "正常"
                        : form.j79 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j80 == 'true'
                      ? 'normal-icon'
                      : form.j80 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  前副卷扬落钩：<span
                    :class="[
                      form.j80 == 'true'
                        ? 'normal'
                        : form.j80 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j80 == "true"
                        ? "正常"
                        : form.j80 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j89 == 'true'
                      ? 'normal-icon'
                      : form.j89 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  前车前限位：<span
                    :class="[
                      form.j89 == 'true'
                        ? 'normal'
                        : form.j89 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j89 == "true"
                        ? "正常"
                        : form.j89 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j90 == 'true'
                      ? 'normal-icon'
                      : form.j90 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  前车后限位：<span
                    :class="[
                      form.j90 == 'true'
                        ? 'normal'
                        : form.j90 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j90 == "true"
                        ? "正常"
                        : form.j90 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j93 == 'true'
                      ? 'normal-icon'
                      : form.j93 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  前主卷扬上限位：<span
                    :class="[
                      form.j93 == 'true'
                        ? 'normal'
                        : form.j93 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j93 == "true"
                        ? "正常"
                        : form.j93 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j94 == 'true'
                      ? 'normal-icon'
                      : form.j94 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  前主卷扬下限位：<span
                    :class="[
                      form.j94 == 'true'
                        ? 'normal'
                        : form.j94 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j94 == "true"
                        ? "正常"
                        : form.j94 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j95 == 'true'
                      ? 'normal-icon'
                      : form.j95 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  前副卷扬上限位：<span
                    :class="[
                      form.j95 == 'true'
                        ? 'normal'
                        : form.j95 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j95 == "true"
                        ? "正常"
                        : form.j95 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j96 == 'true'
                      ? 'normal-icon'
                      : form.j96 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  前副卷扬下限位：<span
                    :class="[
                      form.j96 == 'true'
                        ? 'normal'
                        : form.j96 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j96 == "true"
                        ? "正常"
                        : form.j96 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j101 == 'true'
                      ? 'normal-icon'
                      : form.j101 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  前主卷扬超载：<span
                    :class="[
                      form.j101 == 'true'
                        ? 'normal'
                        : form.j101 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j101 == "true"
                        ? "正常"
                        : form.j101 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j102 == 'true'
                      ? 'normal-icon'
                      : form.j102 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  前主卷扬超速：<span
                    :class="[
                      form.j102 == 'true'
                        ? 'normal'
                        : form.j102 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j102 == "true"
                        ? "正常"
                        : form.j102 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j103 == 'true'
                      ? 'normal-icon'
                      : form.j103 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  前副卷扬超载：<span
                    :class="[
                      form.j103 == 'true'
                        ? 'normal'
                        : form.j103 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j103 == "true"
                        ? "正常"
                        : form.j103 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j104 == 'true'
                      ? 'normal-icon'
                      : form.j104 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  前副卷扬超速：<span
                    :class="[
                      form.j104 == 'true'
                        ? 'normal'
                        : form.j104 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j104 == "true"
                        ? "正常"
                        : form.j104 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
            </div>
          </div>
          <div class="center">
            <div class="time">
              <div class="item">
                <div>累计工作时间</div>
                <div class="total">
                  {{ getDuration(form.j135) }}<span class="unit">小时</span>
                </div>
              </div>
              <div class="item">
                <div>累计工作次数</div>
                <div class="total">
                  {{ form.j136 }}<span class="unit">次</span>
                </div>
              </div>
              <div class="item">
                <div>本次工作时间</div>
                <div class="total">
                  {{ getDuration(form.j137) }}<span class="unit">小时</span>
                </div>
              </div>
            </div>
            <div class="bg">
              <img src="https://jszhgd.cn/static/pc/equipment-app/lmd_2.png" />
            </div>
          </div>
          <div class="right">
            <div class="title">后车参数</div>
            <div class="hook-state">
              <div class="state">
                <span class="fillet">●</span>后车主钩重量：
                <span class="nums">{{ form.j13 }} </span>t
              </div>
              <div class="state">
                <span class="fillet">●</span>后车副钩重量：
                <span class="nums"> {{ form.j16 }} </span>t
              </div>
              <div class="state">
                <span class="fillet">●</span>后车主钩深度：
                <span class="nums">{{ form.j14 }} </span>m
              </div>
              <div class="state">
                <span class="fillet">●</span>后车副钩深度：
                <span class="nums">{{ form.j17 }} </span>m
              </div>
              <div class="state">
                <span class="fillet">●</span>后车主钩速度：
                <span class="nums">{{ form.j15 }} </span>m/s
              </div>
              <div class="state">
                <span class="fillet">●</span>后车副钩速度：
                <span class="nums">{{ form.j18 }} </span>m/s
              </div>
              <div class="state" style="width: 100%">
                <span class="fillet">●</span>后车位置：
                <span class="nums"> {{ form.j21 }} </span>m
              </div>
            </div>
            <div class="qc-container">
              <div class="item">
                <div
                  :class="[
                    form.j75 == 'true'
                      ? 'normal-icon'
                      : form.j75 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  后车前进：<span
                    :class="[
                      form.j75 == 'true'
                        ? 'normal'
                        : form.j75 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j75 == "true"
                        ? "正常"
                        : form.j75 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j76 == 'true'
                      ? 'normal-icon'
                      : form.j76 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  后车后退：<span
                    :class="[
                      form.j76 == 'true'
                        ? 'normal'
                        : form.j76 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j76 == "true"
                        ? "正常"
                        : form.j76 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j81 == 'true'
                      ? 'normal-icon'
                      : form.j81 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  后主卷扬提钩：<span
                    :class="[
                      form.j81 == 'true'
                        ? 'normal'
                        : form.j81 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j81 == "true"
                        ? "正常"
                        : form.j81 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j82 == 'true'
                      ? 'normal-icon'
                      : form.j82 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  后主卷扬落钩：<span
                    :class="[
                      form.j82 == 'true'
                        ? 'normal'
                        : form.j82 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j82 == "true"
                        ? "正常"
                        : form.j82 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j83 == 'true'
                      ? 'normal-icon'
                      : form.j83 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  后副卷扬提钩：<span
                    :class="[
                      form.j83 == 'true'
                        ? 'normal'
                        : form.j83 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j83 == "true"
                        ? "正常"
                        : form.j83 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j84 == 'true'
                      ? 'normal-icon'
                      : form.j84 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  后副卷扬落钩：<span
                    :class="[
                      form.j84 == 'true'
                        ? 'normal'
                        : form.j84 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j84 == "true"
                        ? "正常"
                        : form.j84 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j91 == 'true'
                      ? 'normal-icon'
                      : form.j91 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  后车前限位：<span
                    :class="[
                      form.j91 == 'true'
                        ? 'normal'
                        : form.j91 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j91 == "true"
                        ? "正常"
                        : form.j91 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j92 == 'true'
                      ? 'normal-icon'
                      : form.j92 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  后车后限位：<span
                    :class="[
                      form.j92 == 'true'
                        ? 'normal'
                        : form.j92 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j92 == "true"
                        ? "正常"
                        : form.j92 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j97 == 'true'
                      ? 'normal-icon'
                      : form.j97 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  后主卷扬上限位：<span
                    :class="[
                      form.j97 == 'true'
                        ? 'normal'
                        : form.j97 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j97 == "true"
                        ? "正常"
                        : form.j97 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j98 == 'true'
                      ? 'normal-icon'
                      : form.j98 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  后主卷扬下限位：<span
                    :class="[
                      form.j98 == 'true'
                        ? 'normal'
                        : form.j98 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j98 == "true"
                        ? "正常"
                        : form.j98 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j99 == 'true'
                      ? 'normal-icon'
                      : form.j99 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  后副卷扬上限位：<span
                    :class="[
                      form.j99 == 'true'
                        ? 'normal'
                        : form.j99 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j99 == "true"
                        ? "正常"
                        : form.j99 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j100 == 'true'
                      ? 'normal-icon'
                      : form.j100 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  后副卷扬下限位：<span
                    :class="[
                      form.j100 == 'true'
                        ? 'normal'
                        : form.j100 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j100 == "true"
                        ? "正常"
                        : form.j100 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j105 == 'true'
                      ? 'normal-icon'
                      : form.j105 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  后主卷扬超载：<span
                    :class="[
                      form.j105 == 'true'
                        ? 'normal'
                        : form.j105 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j105 == "true"
                        ? "正常"
                        : form.j105 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j106 == 'true'
                      ? 'normal-icon'
                      : form.j106 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  后主卷扬超速：<span
                    :class="[
                      form.j106 == 'true'
                        ? 'normal'
                        : form.j106 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j106 == "true"
                        ? "正常"
                        : form.j106 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j107 == 'true'
                      ? 'normal-icon'
                      : form.j107 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  后副卷扬超载：<span
                    :class="[
                      form.j107 == 'true'
                        ? 'normal'
                        : form.j107 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j107 == "true"
                        ? "正常"
                        : form.j107 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="item">
                <div
                  :class="[
                    form.j108 == 'true'
                      ? 'normal-icon'
                      : form.j108 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div class="text">
                  后副卷扬超速：<span
                    :class="[
                      form.j108 == 'true'
                        ? 'normal'
                        : form.j108 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j108 == "true"
                        ? "正常"
                        : form.j108 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="bottom">
          <div class="item">
            <div class="title">整车参数</div>
            <div class="complete">
              <div class="position">
                <span class="fillet">●</span>整车位置(左)：
                <span class="nums">{{ form.j19 }} </span>m
              </div>
              <div class="car">
                <div
                  :class="[
                    form.j71 == 'true'
                      ? 'normal-icon'
                      : form.j71 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div>
                  整车左行：<span
                    :class="[
                      form.j71 == 'true'
                        ? 'normal'
                        : form.j71 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j71 == "true"
                        ? "正常"
                        : form.j71 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="car">
                <div
                  :class="[
                    form.j72 == 'true'
                      ? 'normal-icon'
                      : form.j72 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div>
                  整车右行：<span
                    :class="[
                      form.j72 == 'true'
                        ? 'normal'
                        : form.j72 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j72 == "true"
                        ? "正常"
                        : form.j72 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
            </div>
            <div class="complete">
              <div class="position">
                <span class="fillet">●</span>整车位置(右)（大跨度）：
                <span class="nums">{{ form.j23 }} </span>m
              </div>
              <div class="car">
                <div
                  :class="[
                    form.j87 == 'true'
                      ? 'normal-icon'
                      : form.j87 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div>
                  整车左限位：<span
                    :class="[
                      form.j87 == 'true'
                        ? 'normal'
                        : form.j87 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j87 == "true"
                        ? "正常"
                        : form.j87 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
              <div class="car">
                <div
                  :class="[
                    form.j88 == 'true'
                      ? 'normal-icon'
                      : form.j88 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div>
                  整车右限位：<span
                    :class="[
                      form.j88 == 'true'
                        ? 'normal'
                        : form.j88 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j88 == "true"
                        ? "正常"
                        : form.j88 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
            </div>
          </div>
          <div class="item">
            <div class="title">监测参数</div>
            <div class="complete">
              <div class="position">
                <span class="fillet">●</span>风级：
                <span class="nums">{{ form.j22 }} </span>
              </div>
              <div class="position">
                <span class="fillet">●</span>水平x倾角：
                <span class="nums">{{ form.j26 }} </span>°
              </div>
              <div class="position">
                <span class="fillet">●</span>垂直1：
                <span class="nums">{{ form.j28 }} </span>°
              </div>
              <div class="car">
                <div
                  :class="[
                    form.j109 == 'true'
                      ? 'normal-icon'
                      : form.j109 == 'false'
                      ? 'error-icon'
                      : '',
                    'icon',
                  ]"
                ></div>
                <div>
                  风速报警：<span
                    :class="[
                      form.j109 == 'true'
                        ? 'normal'
                        : form.j109 == 'false'
                        ? 'error'
                        : 'cancel',
                      'status',
                    ]"
                  >
                    {{
                      form.j109 == "true"
                        ? "正常"
                        : form.j109 == "false"
                        ? "异常"
                        : "-"
                    }}
                  </span>
                </div>
              </div>
            </div>
            <div class="complete">
              <div class="position">
                <span class="fillet">●</span> 风速：
                <span class="nums"> {{ form.j25 }} </span>m/s
              </div>
              <div class="position">
                <span class="fillet">●</span>水平y倾角：
                <span class="nums">{{ form.j27 }} </span>°
              </div>
              <div class="position">
                <span class="fillet">●</span>垂直2：
                <span class="nums">{{ form.j29 }} </span>°
              </div>
              <div class="car"></div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 历史监测记录 -->
    <monitorRecordPage
      :visible.sync="monitorRecordVisible"
      :equCode="equCode"
    ></monitorRecordPage>
    <!-- 预警推送 -->
    <warningPage
      :visible.sync="warningVisible"
      :equCode="equCode"
    ></warningPage>
  </div>
</template>

<script>
import moment from "moment";
import monitorRecordPage from "./components/monitorRecord.vue";
import warningPage from "./components/warning.vue";
import {
  getLMDEquipment,
  setLMDSpecial,
} from "@/api/wisdom-beam/collect-app.js";
export default {
  components: {
    monitorRecordPage,
    warningPage,
  },
  data() {
    return {
      condition: {
        equSource: [],
        equCode: "",
      },
      //历史监测记录
      monitorRecordVisible: false,
      //预警推送
      warningVisible: false,
      form: {},
      equCode: "",
    };
  },
  mounted() {
    this.getEquipmentData();
  },
  methods: {
    getDuration(seconds) {
      let duration = moment.duration(seconds, "seconds");
      let hours = duration.hours();
      return hours;
    },
    gotoRecord() {
      this.equCode = this.condition.equCode;
      this.monitorRecordVisible = true;
    },
    gotoWarning() {
      this.equCode = this.condition.equCode;
      this.warningVisible = true;
    },
    //查询所有设备
    getEquipmentData() {
      return new Promise((resolve, reject) => {
        getLMDEquipment()
          .then((res) => {
            let { data } = res;
            this.condition.equSource = data?.result || [];
            this.condition.equCode =
              this.condition.equSource?.[0]?.equCode || undefined;
            this.getData();
            resolve();
          })
          .catch((_) => {
            this.condition.equSource = [];
            this.condition.equCode = undefined;
            reject();
          });
      });
    },
    getData() {
      return new Promise((resolve, reject) => {
        let { equCode } = this.condition;
        setLMDSpecial({ equCode })
          .then((res) => {
            let { data } = res;
            this.form = data?.result || {};
            resolve();
          })
          .catch((_) => {
            this.form = {};
            reject();
          });
      });
    },
  },
};
</script>

<style lang="less" scoped>
.lifting-device-container {
  height: 100%;
  .flex();
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  padding: 0 10px 10px 10px;
  .screen-conditions-container {
    margin-right: 0px;
  }
  .header {
    margin: 10px 0px 10px 0;
    padding: 5px 20px;
    background-color: #fff;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    &::before {
      content: attr(header);
      height: 18px;
      border-left: 3px solid var(--primary-color);
      padding-left: 10px;
      font-size: 18px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #525a5d;
      line-height: 18px;
    }
  }
  .main {
    flex: 1;
    height: 100%;
    .custom-scrollbar();
    overflow: overlay !important;
    .body {
      width: 1656px;
      height: 834px;
      .title {
        font-size: 18px;
        color: #0068b7;
      }
      .icon {
        width: 32px;
        height: 32px;
        margin-right: 10px;
      }
      .normal-icon {
        background: url("https://jszhgd.cn/static/pc/equipment-app/green-light.png")
          no-repeat center center;
        background-size: 100% 100%;
      }
      .error-icon {
        background: url("https://jszhgd.cn/static/pc/equipment-app/red-light.png")
          no-repeat center center;
        background-size: 100% 100%;
      }

      .nums {
        color: #2b2c30;
        font-size: 20px;
      }

      .status {
        font-size: 16px;
        font-weight: bold;
      }
      .normal {
        color: #2fba4b;
      }
      .error {
        color: #ff3f4a;
      }
      .cancel {
        color: #aab0bc;
      }

      .fillet {
        color: #0068b7;
        margin-right: 5px;
      }

      .top {
        .flex();
        .left,
        .right {
          width: 480px;
          height: 670px;
          background: #ffffff;
          box-sizing: border-box;
          padding: 20px 16px;
          .hook-state {
            .flex();
            flex-wrap: wrap;
            font-size: 16px;
            color: #525a5d;
            .state {
              width: 224px;
              margin-bottom: 10px;
            }
          }
          .qc-container {
            .flex();
            flex-wrap: wrap;
            .item {
              width: 224px;
              .flex();
              align-items: center;
              margin-bottom: 20px;
              .text {
                font-size: 16px;
                color: #525a5d;
              }
              &:nth-last-child(2) {
                margin-bottom: 0;
              }
              &:nth-last-child(1) {
                margin-bottom: 0;
              }
            }
          }
        }
        .center {
          margin: 0 10px;
          width: 676px;
          height: 670px;
          background: #ffffff;
          box-sizing: border-box;
          padding: 20px 30px;
          .time {
            margin: 0 20px;
            .flex();
            align-items: center;
            justify-content: space-between;
            .item {
              width: 178px;
              height: 90px;
              background: #eef8ff;
              border-radius: 4px;
              .flex();
              flex-direction: column;
              align-items: center;
              justify-content: center;
              font-size: 16px;
              color: #0068b7;
              .total {
                font-weight: bold;
                font-size: 24px;
                overflow: hidden;
                text-overflow: ellipsis;
                display: -webkit-box;
                -webkit-box-orient: vertical;
                -webkit-line-clamp: 1;
              }
              .unit {
                font-size: 16px;
                font-weight: normal;
              }
            }
          }
          .bg {
            margin-top: 60px;
            flex: 1;
            img {
              width: 588px;
              height: 422px;
            }
          }
        }
      }
      .bottom {
        margin-top: 10px;
        .flex();
        .item {
          width: 822px;
          height: 154px;
          background: #ffffff;
          margin-right: 10px;
          box-sizing: border-box;
          padding: 20px 16px;
          &:last-of-type {
            margin-right: 0;
          }
          .complete {
            .flex();
            align-items: center;
            justify-content: space-between;
            margin-top: 10px;
            .position {
              font-size: 16px;
              color: #525a5d;
              width: 290px;
              .flex();
              align-items: center;
            }
            .car {
              font-size: 16px;
              color: #525a5d;
              width: 220px;
              .flex();
              align-items: center;
            }
          }
        }
      }
    }
  }
}
</style>
